package com.leyou.item.service.iml;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.leyou.item.dto.SpecParamDTO;
import com.leyou.item.entity.SpecParam;
import com.leyou.item.mapper.ParamMapper;
import com.leyou.item.service.ParamService;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ParamServiceImpl extends ServiceImpl<ParamMapper, SpecParam> implements ParamService {
    @Override
    public List<SpecParamDTO> paramQuery(Long categoryId, Long groupId) {
        List<SpecParam> list = query().eq(categoryId != null, "category_id", categoryId)
                .eq(groupId != null, "group_id", groupId)
                .list();

        return SpecParamDTO.convertEntityList(list);
    }

    @Override
    public List<SpecParamDTO> querySpecValues(Long id, Boolean searching) {
        return null;
    }
}
